home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0044_ARRAY Pointer in ASM.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  815b  |  28 lines

  1. {
  2. MAYNARD PHILBROOK
  3.  
  4. >> I've never had to do this, so I'm not sure, but can't you just pass a
  5. >> pointer to the array? eg.
  6. >> type
  7. >>   DorkArray = Array[0..255] of Byte;
  8. >> var
  9. >>   Dork : ^DorkArray;
  10. >
  11. > but what exactly do I declare in the assembly procedure to get thses
  12. > values?
  13. }
  14. ASm
  15.    Mov   Word AX, [Dork];
  16.    Mov   Word BX, [Dork+2];
  17.    Mov   ES, BX;
  18.    Mov   BX, AX;
  19.    { Now ES:BX } {equal the same value as Dork}
  20.    Mov    Byte AL, [ES:BX];   {Get the first byte of Dork into AL. }
  21.    Mov    Byte AL, [ES:BX+1]; {Get the Secoce Byte of Dork into al.}
  22.    Mov    Word SI, 00;
  23.    Mov    AL, [ES:BX+SI]; {also do this.}
  24.    Inc    SI;
  25.    Mov    AL  {ES:BX+SI]; Ect//
  26.  { Another way to load up a poiter }
  27.    LES    Dowrd BX, [Dork];   { This is simpler way of defining a piiner.
  28.